home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C++ / Applications / SeeMovieRun 2.0 / Source / CQTPane.cp < prev    next >
Encoding:
Text File  |  1995-08-02  |  5.3 KB  |  175 lines  |  [TEXT/KAHL]

  1. /**********************************************************************
  2.  CQTPane.c
  3.  
  4.     Pane methods for the QuickTime demo application.
  5.  
  6.     Copyright © 1992 Joe Zobkiw.  All rights reserved.
  7.     Portions Copyright © 1990 Symantec Corporation.  All rights reserved.
  8.  
  9.     Copyright © 1995 Gregory Bonk. All rights reserved.
  10.         Changes upgrade to TPM 7.0.7
  11.  *********************************************************************/
  12.  
  13.  
  14. //    Most applications will want a scrollable window, so this
  15. //    class is based on the class CPanorama. All the methods here
  16. //    would still apply to classes based directly on CPane.
  17.  
  18.  
  19. #include "CQTPane.h"
  20. #include "Defines.h"
  21. #include "CMovie.h"
  22. #include "QuickTime Utilities.h"
  23. #include <CBartender.h>
  24.  
  25. extern    CBartender    *gBartender;    //    The menu handling object
  26.  
  27. TCL_DEFINE_CLASS_D1(CQTPane, CPanorama);
  28.  
  29. /**** C O N S T R U C T I O N / D E S T R U C T I O N   M E T H O D S ****/
  30.  
  31. CQTPane::CQTPane()
  32. {
  33.     TCL_END_CONSTRUCTOR
  34. }
  35.  
  36.  
  37. CQTPane::~CQTPane()
  38. {
  39.     TCL_START_DESTRUCTOR
  40. }
  41.  
  42.  
  43. void CQTPane::IQTPane(CView *anEnclosure, CBureaucrat *aSupervisor,    short aWidth, short aHeight,
  44.                             short aHEncl, short aVEncl,
  45.                             SizingOption aHSizing, SizingOption aVSizing,FSSpec *movieSpec)
  46. {
  47.     CPanorama::IPanorama(anEnclosure, aSupervisor, aWidth, aHeight,    aHEncl, aVEncl, aHSizing, aVSizing);
  48.     
  49.     SetWantsClicks(TRUE);
  50.         
  51. //    create our subpane to hold the movie
  52.     itsMoviePane = new CMovie();
  53.     itsMoviePane->IMovie(this, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing, movieSpec);
  54. }
  55.  
  56. /**************************************************************************
  57.  DoCommand
  58.  
  59.     This is the heart of your pane.
  60.     In this method, you handle all the commands your pane deals with.
  61.  *************************************************************************/
  62. void CQTPane::DoCommand(long theCommand)
  63. {
  64.     switch (theCommand)
  65.     {
  66.     default:
  67.         inherited::DoCommand(theCommand);
  68.         break;
  69.     }
  70. }
  71.  
  72.  
  73. /**************************************************************************
  74.  UpdateMenus
  75.     
  76.     In this method you can enable menu commands that apply when
  77.     your pane is active.
  78.  *************************************************************************/
  79. void CQTPane::UpdateMenus()
  80. {
  81.     inherited::UpdateMenus();
  82. }
  83.  
  84. /**************************************************************************
  85.  ImportMovie
  86.  
  87.     Import a movie into an existing document.
  88.  *************************************************************************/
  89. void CQTPane::ImportMovie(FSSpec *spec)
  90. {
  91.     itsMoviePane->ImportMovie(spec);
  92. }
  93.  
  94. /**************************************************************************
  95.  Draw
  96.  
  97.     In this method, you draw whatever you need to display in
  98.     your pane. The area parameter gives the portion of the 
  99.     pane that needs to be redrawn. Area is in frame coordinates.
  100.  *************************************************************************/
  101. void CQTPane::Draw(Rect *area)
  102. {
  103.  
  104. }
  105.  
  106.  
  107. /**************************************************************************
  108.  DoClick
  109.  
  110.     The mouse went down in the pane.
  111.     In this method you do whatever is appropriate for your
  112.     application. HitPt is given in frame coordinates. The other
  113.     parameters, modiferKeys and when, are taken from the event
  114.     record.
  115.     
  116.     If you want to implement mouse tracking, this is the method
  117.     to do it in. You need to create a subclass of CMouseTask and
  118.     pass it in a TrackMouse() message to the pane.
  119.  *************************************************************************/
  120. void CQTPane::DoClick(Point hitPt, short modifierKeys, long when)
  121. {
  122.  
  123. }
  124.  
  125.  
  126. /**************************************************************************
  127.  HitSamePart
  128.  
  129.     Test whether pointA and pointB are in the same part.
  130.     "The same part" means different things for different applications.
  131.     In the default method, "the same part" means "in the same pane."
  132.     If you want a different behavior, override this method. For instance,
  133.     two points might be in the same part if they're within n pixels
  134.     of each other.
  135.  
  136.     PointA and pointB are both in frame coordinates.
  137.  *************************************************************************/
  138. Boolean     CQTPane::HitSamePart(Point pointA, Point pointB)
  139. {
  140.     return inherited::HitSamePart(pointA, pointB);
  141. }
  142.  
  143.  
  144. /**************************************************************************
  145.  AdjustCursor
  146.  
  147.     If you want the cursor to have a different shape in your pane,
  148.     do it in this method. If you want a different cursor for different
  149.     parts of the same pane, you'll need to change the mouseRgn like this:
  150.         1. Create a region for the "special area" of your pane.
  151.         2. Convert this region to global coordinates
  152.         3. Set the mouseRgn to the intersection of this region
  153.            and the original mouseRgn: SectRgn(mouseRgn, myRgn, mouseRgn);
  154.     
  155.     The default method just sets the cursor to the arrow. If this is fine
  156.     for you, don't override this method.
  157.  *************************************************************************/
  158. void CQTPane::AdjustCursor(Point where, RgnHandle mouseRgn)
  159. {
  160.     inherited::AdjustCursor(where, mouseRgn);
  161. }
  162.  
  163.  
  164. /**************************************************************************
  165.  ScrollToSelection
  166.  
  167.     If your pane is based on a Panorama (as this example is), you might
  168.     want to define what it means to have a selection and what it means to
  169.     scroll to that selection.
  170.  *************************************************************************/
  171. void CQTPane::ScrollToSelection(void)
  172. {
  173.     //    scroll to the selection
  174. }
  175.